package com.xiaoq.sites.vo;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by chenjh on 2018/1/15.
 */
public class SitesWeatherVo {

    @ApiModelProperty(name = "currentCity", value = "城市", position=10)
    private String currentCity = "";

    @ApiModelProperty(name = "pm25", value = "PM2.5", position=20)
    private String pm25 = "";

    @ApiModelProperty(name = "date", value = "时间", position=30)
    private String date = "";

    @ApiModelProperty(name = "dayPictureUrl", value = "白天天气URL图片", position=40)
    private String dayPictureUrl = "";

    @ApiModelProperty(name = "nightPictureUrl", value = "夜晚天气URL图片", position=50)
    private String nightPictureUrl = "";

    @ApiModelProperty(name = "weather", value = "天气", position=60)
    private String weather = "";

    @ApiModelProperty(name = "wind", value = "风", position=70)
    private String wind = "";

    @ApiModelProperty(name = "temperature", value = "温度", position=80)
    private String temperature = "";

	@ApiModelProperty(name = "pmLevel", value = "pm2.5的级别", position=90)
	private String pmLevel = "";


	public String getCurrentCity() {
		return currentCity;
	}

	public void setCurrentCity(String currentCity) {
		this.currentCity = currentCity;
	}

	public String getPm25() {
		return pm25;
	}

	public void setPm25(String pm25) {
		this.pm25 = pm25;

		//
		if(StringUtils.isNotBlank(pm25) && StringUtils.isNumeric(pm25)){
			int pm25Int = Integer.parseInt(pm25);
			if(pm25Int <= 50){
				pmLevel = "优";
			}else if (pm25Int <= 100){
				pmLevel = "良";
			}else if (pm25Int <= 150){
				pmLevel = "轻度";
			}else if (pm25Int <= 200){
				pmLevel = "中度";
			}else if (pm25Int <= 300){
				pmLevel = "重度";
			}else {
				pmLevel = "严重";
			}
		}

	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getDayPictureUrl() {
		return dayPictureUrl;
	}

	public void setDayPictureUrl(String dayPictureUrl) {
		this.dayPictureUrl = dayPictureUrl;
	}

	public String getNightPictureUrl() {
		return nightPictureUrl;
	}

	public void setNightPictureUrl(String nightPictureUrl) {
		this.nightPictureUrl = nightPictureUrl;
	}

	public String getWeather() {
		return weather;
	}

	public void setWeather(String weather) {
		this.weather = weather;
	}

	public String getWind() {
		return wind;
	}

	public void setWind(String wind) {
		this.wind = wind;
	}

	public String getTemperature() {
		return temperature;
	}

	public void setTemperature(String temperature) {
		this.temperature = temperature;
	}

	public String getPmLevel() {
		return pmLevel;
	}

	public void setPmLevel(String pmLevel) {
		this.pmLevel = pmLevel;
	}
}
